package ModelLayer; //makes this class a part of the ModelLayer package
import java.util.*;

/**
 * 
 * <code>Person</code> class stores information about a friend. The data in it is managed by the <code>AddressBook</code>
 * 
 * @author (dmaj0913 - group 2) 
 * @version (2013.11.08)
 */
public class Person
{
    private long id;
    private String name;
    private String address;
    private String postalCode;
    private String city;
    private String phone;
    
    /** 
     * Constructor for objects of class <code>Person</code> creates a new friend with all needed information.
     *@param id stores a number of type long that serves as an ID of the person.
     *@param name stores a character string with the name of a person.
     *@param address stores a character string with the address of a person.
     *@param postalCode stores a character string with the Postal Code of the city where the person lives.
     *@param city stores a character string with the city where a person live.
     *@param phone stores a character string with the phone number of a person.
     */
    public Person(long id, String name, String address, String postalCode, String city, String phone)
    {
        this.id = id;
        this.name = name;
        this.address = address;
        this.postalCode = postalCode;
        this.city = city;
        this.phone = phone;
    }
    
    /**
     * Returns the name of this friend.
     * @return Character string with the name of the person.
     */
    public String getName()
    {
        return name;
    }
    
    /**
     * Returns the address of this friend.
     * @return Character string with the address of the person.
     */
    public String getAddress()
    {
        return address;
    }
    
    /**
     * Returns the ID of this friend.
     * @return number of type long with the ID of the person.
     */
    public long getId()
    {
        return id;
    }
    
    /**
     * Returns the Post Code of the City where this friend lives.
     * @return Character string with the Postal Code of the person.
     */
    public String getPostalCode()
    {
        return postalCode;
    }
    
    /**
     * Returns the city of this friend.
     * @return Character string with the city of the person.
     */
    public String getCity()
    {
        return city;
    }
    
    /**
     * Returns the name of this friend.
     * @return Character string with the phone number of the person.
     */
    public String getPhoneNumber()
    {
        return phone;
    }
    
    /**
     * Changes the name of a friend with a desired new one.
     * @param x Character string with the new name of the person.
     */
    public void setName(String x)
    {
        name = x;
    }
    
    /**
     * Changes the address of a friend with a desired new one.
     * @param x Character string with the new address of the person.
     */
    public void setAddress(String x)
    {
        address = x;
    }
    
    /**
     * Changes the ID of a friend with a desired new one.
     * @param x number of type long with the new ID of the person.
     */
    public void setId(long x)
    {
        id = x;
    }
    
    /**
     * Changes the phone number of a friend with a desired new one.
     * @param x Character string with the person's new phone number.
     */
    public void setPhoneNumber(String x)
    {
        phone = x;
    }
    
    /**
     * Changes the city field of a friend with a desired new one.
     * @param x Character string with the person's new city he is living in.
     */
    public void setCity(String x)
    {
        city = x;
    }
    
    /**
     * Changes the phone postal code of a friend with a desired new one.
     * @param x Character string with the person's new postal code.
     */
    public void setPostalCode(String x)
    {
        postalCode = x;
    }
    
    /**
     * Prints out in the Terminal all the information about a friend(Name, ID, address, city, postal code, phone).
     */
    public void printInformation()
    {
        System.out.println("Name: " + name);
        System.out.println("ID: " + id);
        System.out.println("Address: " + address);
        System.out.println("City: " + city);
        System.out.println("Postal code: " + postalCode);
        System.out.println("Phone number: " + phone);
    }
    
}
